package basictype;

import org.junit.jupiter.api.Test;

import java.util.Stack;

/**
 * 对基本类型的测试
 * @author: kejl
 * @create: 2020-07-05 14:45
 */
public class BasicTypeTest {

    /**
     * 发生整数越界的情况
     */
    @Test
    public void tedtMaxInt(){
        System.out.println(Integer.MAX_VALUE);//2147483647
        int max = Integer.MAX_VALUE+1;
        System.out.println(max); //-2147483647

    }

    /**
     * char to int
     * numchar - 48)
     */
    @Test
    public void testCharToInt(){
        char numchar = '9';
        System.out.println(numchar - 48);
    }

    /**
     * string to CharArray
     *  str.toCharArray();
     */
    @Test
    public void stringToCharArray() {
        String str = "safdsddfs";
        str.toCharArray();
        for (char charstr : str.toCharArray()) {
            System.out.println(charstr + "");
            Stack<String> stringStack = new Stack<String>();
            stringStack.pop();

        }
    }

}
